<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ConfigUpdateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $return = [
            'name' => 'required',
            'description' => 'required',
            'code' => 'required',
            'tel' => 'required',
            'email' => 'required',
            'address' => 'required'
        ];
        return $return;
    }

    /**
     * 自定义错误信息
     * @return array
     */
    public function messages()
    {
        return [
            'name.required' => '站点名称不能为空',
            'description.required'  => '关键字不能为空',
            'code.required'=>'公众号二维码不能为空',
            'tel.required'=>'电话不能为空',
            'email.required'=>'邮箱不能为空',
            'address.required'=>'地址不能为空'
        ];
    }

}